home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disc 39 / Commodore_Disc_39_19xx_-_de.d64 / 18 uhren (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  9KB  |  465 lines

  1. 10 rem******************
  2. 20 rem* 18 uhren     ***
  3. 30 rem* ein programm ***
  4. 40 rem* fuer den c64 ***
  5. 50 rem*              ***
  6. 60 rem* von          ***
  7. 70 rem* g. kramer    ***
  8. 80 rem*              ***
  9. 90 rem******************
  10. 100 gosub200
  11. 110 gosub720
  12. 120 gosub1350
  13. 130 ifs=0then160
  14. 140 gosub2610
  15. 150 s=0:goto110
  16. 160 end
  17. 170 rem******************
  18. 180 rem* anfangswerte ***
  19. 190 rem******************
  20. 200 poke53281,0:poke53280,0
  21. 210 printchr$(147)
  22. 220 b=1024:f=55296
  23. 230 a=rnd(-ti)
  24. 240 dimz(17,2),k(7,1),v(7,4)
  25. 250 dimr(11),s(4)
  26. 260 dimzm(17),km(7),sm(4)
  27. 270 a=peek(61)+256*peek(62)
  28. 280 poke65,aand255:poke66,a/256
  29. 290 fori=0to5
  30. 300 readr(i):r(i+6)=-r(i):next
  31. 310 data-80,-79,-38,2,42,81
  32. 320 a=peek(61)+256*peek(62)
  33. 330 poke65,aand255:poke66,a/256
  34. 340 fori=0to7:forj=0to4
  35. 350 readv(i,j):nextj,i
  36. 360 return
  37. 370 data0,1,3,4,6,6,3,4,7,7
  38. 380 data2,1,4,5,4,8,4,5,7,5
  39. 390 data9,10,12,13,2,15,12,13,16,3
  40. 400 data11,10,13,14,0,17,13,14,16,1
  41. 410 rem*********************
  42. 420 rem* zeilen loeschen ***
  43. 430 rem*********************
  44. 440 fori=atoa0
  45. 450 poke781,i:sys59903:next
  46. 460 return
  47. 470 rem*******************
  48. 480 rem* grundstellung ***
  49. 490 rem*******************
  50. 500 a=peek(61)+256*peek(62)
  51. 510 poke65,aand255:poke66,a/256
  52. 520 fori=0to17
  53. 530 z(i,0)=0
  54. 540 readz(i,1)
  55. 550 ifi>7then580
  56. 560 k(i,0)=0
  57. 570 readk(i,1)
  58. 580 next:return
  59. 590 data123,246,129,486,135,252
  60. 600 data363,492,369,266,375,506
  61. 610 data603,272,609,512,615,143
  62. 620 data149,155,383,389,395,623
  63. 630 data629,635
  64. 640 rem*******************
  65. 650 rem* cursor setzen ***
  66. 660 rem*******************
  67. 670 poke214,ze:poke211,sp
  68. 680 sys58640:return
  69. 690 rem***************
  70. 700 rem* titelbild ***
  71. 710 rem***************
  72. 720 a0$=chr$(113)+chr$(113)+chr$(113)
  73. 730 a1$=chr$(113)+chr$(32)+chr$(32)
  74. 740 a1$=a1$+chr$(32)+chr$(113)
  75. 750 a2$=chr$(117)+chr$(99)+chr$(105)
  76. 760 a3$=chr$(98)+chr$(18)+chr$(123)
  77. 770 a3$=a3$+chr$(146)+chr$(98)
  78. 780 a4$=chr$(106)+chr$(99)+chr$(107)
  79. 790 printchr$(147)
  80. 800 fori=1to3:forj=0to4
  81. 810 ifj=0thena5$=chr$(156)+a0$
  82. 820 ifj=1thena5$=chr$(156)+a1$
  83. 830 ifj=4thena5$=chr$(156)+a0$
  84. 840 fork=0to5
  85. 850 a=1:if(j=0)or(j=4)thena=2
  86. 860 ifk>0thena=a+(a-1)
  87. 870 ifk=3thena=a+2
  88. 880 printspc(a)a5$;
  89. 890 next:print
  90. 900 next:print:next
  91. 910 printchr$(150)
  92. 920 fori=99to739step40
  93. 930 pokef+i,13:pokeb+i,66
  94. 940 next
  95. 950 fori=760to798
  96. 960 pokef+i,13:pokeb+i,64
  97. 970 next
  98. 980 pokeb+779,113
  99. 990 printchr$(19):print:print:print
  100. 1000 print:fori=0to1:fork=0to2
  101. 1010 forj=0to3
  102. 1020 a5$=a2$
  103. 1030 ifk=1thena5$=a3$
  104. 1040 ifk=2thena5$=a4$
  105. 1050 a=5:ifj>0thena=3
  106. 1060 ifj=2thena=11
  107. 1070 printspc(a)a5$;:next
  108. 1080 print:next
  109. 1090 print:print:print
  110. 1100 next
  111. 1110 sp=15:ze=20:gosub670
  112. 1120 printchr$(154)"18 uhren":print
  113. 1130 printtab(11)"ein programm von"
  114. 1140 printchr$(158)
  115. 1150 printtab(12)"guenter kramer";
  116. 1160 geta$:ifa$=""then1160
  117. 1170 return
  118. 1180 rem********************
  119. 1190 rem* anzahl spieler ***
  120. 1200 rem********************
  121. 1210 a=20:a0=24:gosub440
  122. 1220 printchr$(158)chr$(19)
  123. 1230 sp=0:ze=20:gosub670
  124. 1240 print"bitte eingeben:"
  125. 1250 printtab(14)"1 = ein spieler"
  126. 1260 printtab(14)"2 = zwei spieler"
  127. 1270 poke198,0
  128. 1280 geta$:ifa$=""then1280
  129. 1290 s=val(a$)
  130. 1300 if(s<1)or(s>2)then1280
  131. 1310 return
  132. 1320 rem**********************
  133. 1330 rem* spiel einstellen ***
  134. 1340 rem**********************
  135. 1350 a=20:a0=24:gosub440:gosub500
  136. 1360 fori=0to17
  137. 1370 pokef+r(z(i,2))+z(i,1),7
  138. 1380 next
  139. 1390 printchr$(158)chr$(19)
  140. 1400 sp=0:ze=20:gosub670
  141. 1410 print"bitte eingeben:"
  142. 1420 printtab(14)"f1 = zufallsspiel"
  143. 1430 printtab(14)"f3 = grundstellung"
  144. 1440 printtab(14)"f5 = spiel laden"
  145. 1450 printtab(14)"f8 = spielende";
  146. 1460 poke198,0:s=0
  147. 1470 geta$:ifa$=""then1470
  148. 1480 a=asc(a$):ifa=133then1530
  149. 1490 ifa=140then1550
  150. 1500 ifa=134then1540
  151. 1510 ifa<>135then1470
  152. 1520 ei=999:gosub4140:goto1550
  153. 1530 gosub1590
  154. 1540 gosub1210
  155. 1550 return
  156. 1560 rem******************
  157. 1570 rem* zufallsspiel ***
  158. 1580 rem******************
  159. 1590 fori0=0to3:i1=int(rnd(0)*2)
  160. 1600 ifai1=0theni1=-1
  161. 1610 fori2=0toint(rnd(0)*7)
  162. 1620 a=i0:a0=i1:gosub1870:nexti2,i0
  163. 1630 fori=1to7step2
  164. 1640 a=int(rnd(0)*12)
  165. 1650 z(i,0)=a
  166. 1660 a=int(rnd(0)*12)
  167. 1670 z(i+9,0)=a
  168. 1680 next
  169. 1690 a=int(rnd(0)*12)
  170. 1700 z(4,0)=a
  171. 1710 a=int(rnd(0)*12)
  172. 1720 z(13,0)=a
  173. 1730 gosub3370
  174. 1740 return
  175. 1750 rem*******************
  176. 1760 rem* knopf ein/aus ***
  177. 1770 rem*******************
  178. 1780 k(a,0)=(k(a,0)+1)and1
  179. 1790 a1=10:ifk(a,0)=1thena1=7
  180. 1800 fori=-1to1:forj=-40to40step40
  181. 1810 pokef+k(a,1)+i+j,a1
  182. 1820 nextj,i
  183. 1830 return
  184. 1840 rem******************
  185. 1850 rem* knopf drehen ***
  186. 1860 rem******************
  187. 1870 fori=0to1
  188. 1880 z(v(a,0),2)=a0
  189. 1890 ifk(a,0)=0then1920
  190. 1900 forj=1to3
  191. 1910 z(v(a,j),2)=a0:next
  192. 1920 a0=a0*-1:a=v(a,4)
  193. 1930 next
  194. 1940 fori=0to1:forj=0to7
  195. 1950 ifk(j,0)=0then2050
  196. 1960 a0=0:fork=0to3
  197. 1970 a0=z(v(j,k),2)
  198. 1980 ifa0<>0thenk=4
  199. 1990 next
  200. 2000 ifa0=0then2050
  201. 2010 z(v(v(j,4),0),2)=-a0
  202. 2020 fork=0to3
  203. 2030 z(v(j,k),2)=a0
  204. 2040 next
  205. 2050 nextj,i
  206. 2060 fori=0to17
  207. 2070 a=z(i,2)
  208. 2080 ifa=0then2160
  209. 2090 a0=z(i,0):a1=z(i,1)
  210. 2100 pokef+a1+r(a0),4
  211. 2110 a0=a0+a
  212. 2120 ifa0=12thena0=0
  213. 2130 ifa0<0thena0=11
  214. 2140 pokef+a1+r(a0),7
  215. 2150 z(i,0)=a0:z(i,2)=0
  216. 2160 next:return
  217. 2170 rem*************
  218. 2180 rem* eingabe ***
  219. 2190 rem*************
  220. 2200 ei=0
  221. 2210 poke56322,224
  222. 2220 a=peek(56320)
  223. 2230 ifas=1thena=peek(56321)
  224. 2240 poke56322,255
  225. 2250 if(aand31)<31then2280
  226. 2260 geta$:ifa$=""then2340
  227. 2270 ei=asc(a$):goto2330
  228. 2280 if(aand1)=0thenei=1
  229. 2290 if(aand2)=0thenei=2
  230. 2300 if(aand4)=0thenei=3
  231. 2310 if(aand8)=0thenei=4
  232. 2320 if(aand16)=0thenei=5
  233. 2330 poke198,0
  234. 2340 return
  235. 2350 rem**********************
  236. 2360 rem* bildunterschrift ***
  237. 2370 rem**********************
  238. 2380 a=20:a0=24:gosub440
  239. 2390 printchr$(19)chr$(158)
  240. 2400 sp=0:ze=20:gosub670
  241. 2410 print"f1 = spielstand merken"
  242. 2420 print"f3 = spielstand zurueck"
  243. 2430 print"f7 = spiel speichern"
  244. 2440 print"f8 = spiel abbrechen"
  245. 2450 pokef+828,1:pokeb+828,85
  246. 2460 fori=829to837
  247. 2470 pokef+i,1:pokeb+i,64:next
  248. 2480 pokef+838,1:pokeb+838,73
  249. 2490 pokef+878,1:pokeb+878,66
  250. 2500 pokef+918,1:pokeb+918,66
  251. 2510 pokef+958,1:pokeb+958,75
  252. 2520 fori=957to949step-1
  253. 2530 pokef+i,1:pokeb+i,64:next
  254. 2540 pokef+948,1:pokeb+948,74
  255. 2550 pokef+908,1:pokeb+908,66
  256. 2560 pokef+868,1:pokeb+868,66
  257. 2570 return
  258. 2580 rem******************
  259. 2590 rem* spiel laeuft ***
  260. 2600 rem******************
  261. 2610 gosub2380:ifei=999then2650
  262. 2620 s(1)=0:s(2)=4:s(3)=0:s(4)=0:as=0
  263. 2630 as=as+1:ifas>sthenas=1
  264. 2640 s(as+2)=s(as+2)+1
  265. 2650 a$=str$(s(as+2))
  266. 2660 ze=0:sp=17+int(len(a$)/2)
  267. 2670 gosub670:printchr$(158)a$
  268. 2680 ifs=1then2720
  269. 2690 a$=str$(s(3)+s(4))
  270. 2700 ze=0:sp=7+20*(as-1)+int(len(a$)/2)
  271. 2710 gosub670:printa$
  272. 2720 ze=21:sp=29:gosub670
  273. 2730 a=153:ifas=2thena=150
  274. 2740 printchr$(a)"spieler"as
  275. 2750 printtab(31)"joy"as
  276. 2760 c=k(s(as),1)
  277. 2770 pokeb+c,86
  278. 2780 gosub2200
  279. 2790 fori=0to50
  280. 2800 ifei>0then2850
  281. 2810 pokeb+c,91
  282. 2820 gosub2200
  283. 2830 fori=0to50
  284. 2840 ifei=0then2770
  285. 2850 pokeb+c,219:a=s(as)
  286. 2860 ifei=2then2990
  287. 2870 ifei=1then3040
  288. 2880 ifei=3thena0=-1:goto2960
  289. 2890 ifei=4thena0=1:goto2960
  290. 2900 ifei=5thengosub1780
  291. 2910 ifei=133thengosub3140
  292. 2920 ifei=134thengosub3240:goto2650
  293. 2930 ifei=136thengosub3820:goto2650
  294. 2940 ifei=140then3100
  295. 2950 goto2760
  296. 2960 gosub1870
  297. 2970 ifs=2then2630
  298. 2980 goto2640
  299. 2990 s(as)=s(as)+1
  300. 3000 if(s=2)and(s(as)=4)thens(as)=0
  301. 3010 ifs(as)<8then2760
  302. 3020 s(as)=0:ifas=2thens(as)=4
  303. 3030 goto2760
  304. 3040 s(as)=s(as)-1
  305. 3050 if(as=2)and(s(as)=3)thens(as)=7
  306. 3060 ifs(as)>=0then2760
  307. 3070 s(as)=7
  308. 3080 if(s=2)thens(as)=3
  309. 3090 goto2760
  310. 3100 return
  311. 3110 rem***********************
  312. 3120 rem* spielstand merken ***
  313. 3130 rem***********************
  314. 3140 fori=0to17
  315. 3150 zm(i)=z(i,0)
  316. 3160 ifi>7then3190
  317. 3170 km(i)=k(i,0)
  318. 3180 ifi<5thensm(i)=s(i)
  319. 3190 next
  320. 3200 am=as:return
  321. 3210 rem************************
  322. 3220 rem* spielstand zurueck ***
  323. 3230 rem************************
  324. 3240 fori=0to17
  325. 3250 a=z(i,0):z(i,0)=zm(i):zm(i)=a
  326. 3260 ifi>7then3300
  327. 3270 a=k(i,0):k(i,0)=km(i):km(i)=a
  328. 3280 ifi>4then3300
  329. 3290 a=s(i):s(i)=sm(i):sm(i)=a
  330. 3300 next
  331. 3310 a=0:a0=0:gosub440
  332. 3320 a=as:as=am:am=a
  333. 3330 gosub3370:gosub3450:return
  334. 3340 rem*******************
  335. 3350 rem* zeiger setzen ***
  336. 3360 rem*******************
  337. 3370 fori=0to17:a=z(i,1)+f
  338. 3380 forj=0to11:a0=4
  339. 3390 ifj=z(i,0)thena0=7
  340. 3400 pokea+r(j),a0
  341. 3410 nextj,i:return
  342. 3420 rem********************
  343. 3430 rem* knoepfe setzen ***
  344. 3440 rem********************
  345. 3450 fora=0to7
  346. 3460 gosub1790
  347. 3470 next:return
  348. 3480 rem***********************
  349. 3490 rem* abfrage dateiname ***
  350. 3500 rem***********************
  351. 3510 a=20:a0=24:gosub440
  352. 3520 printchr$(19)chr$(156)
  353. 3530 sp=0:ze=20:gosub670
  354. 3540 printa$
  355. 3550 print
  356. 3560 print"name der datei?"
  357. 3570 a0$="":poke198,0:a0=0
  358. 3580 geta$
  359. 3590 if(a1$="0")or(a0>0)then3620
  360. 3600 ifa$="$"thengosub4410
  361. 3610 ifa0$<>""then3780
  362. 3620 ifa0=0then3660
  363. 3630 ifa$=chr$(20)then3750
  364. 3640 ifa$=chr$(13)then3700
  365. 3650 ifa$=chr$(32)then3690
  366. 3660 ifa$<"."then3580
  367. 3670 ifa$<":"then3690
  368. 3680 if(a$<"a")or(a$>"z")then3580
  369. 3690 a0$=a0$+a$:a0=a0+1
  370. 3700 sp=16:ze=22:gosub670
  371. 3710 printa0$+chr$(32)
  372. 3720 ifa$=chr$(13)then3780
  373. 3730 ifa0<16then3580
  374. 3740 goto3780
  375. 3750 a0=a0-1
  376. 3760 a0$=left$(a0$,a0)
  377. 3770 goto3700
  378. 3780 return
  379. 3790 rem*********************
  380. 3800 rem* spiel speichern ***
  381. 3810 rem*********************
  382. 3820 a$="spiel speichern"
  383. 3830 a1$="0":gosub3510
  384. 3840 open1,8,15
  385. 3850 print#1,"s:"+a0$
  386. 3860 close1
  387. 3870 open15,8,15
  388. 3880 open3,8,3,"0:"+a0$+",u,w"
  389. 3890 input#15,a0,a$,a1,a2
  390. 3900 ifa0=0then4010
  391. 3910 close3:close15
  392. 3920 printchr$(158)a0;a$;a1;a2
  393. 3930 printchr$(156)"abbrechen?[160](j/n)";
  394. 3940 poke198,0
  395. 3950 geta$
  396. 3960 ifa$="j"then4090
  397. 3970 ifa$<>"n"then3950
  398. 3980 a=23:a0=24:gosub440
  399. 3990 ze=23:sp=0:gosub670
  400. 4000 goto3870
  401. 4010 fori=0to17
  402. 4020 print#3,z(i,0):next
  403. 4030 fori=0to7
  404. 4040 print#3,k(i,0):next
  405. 4050 print#3,s:print#3,as
  406. 4060 fori=1to4
  407. 4070 print#3,s(i):next
  408. 4080 close3:close15
  409. 4090 gosub2380
  410. 4100 return
  411. 4110 rem*****************
  412. 4120 rem* spiel laden ***
  413. 4130 rem*****************
  414. 4140 a$="spiel laden"
  415. 4150 a1$="1":gosub3510
  416. 4160 open15,8,15
  417. 4170 open3,8,3,"0:"+a0$+",u,r"
  418. 4180 input#15,a0,a$,a1,a2
  419. 4190 ifa0=0then4280
  420. 4200 close3:close15
  421. 4210 printchr$(158)a0;a$;a1;a2
  422. 4220 printchr$(156)"abbrechen?[160](j/n)";
  423. 4230 poke198,0
  424. 4240 geta$
  425. 4250 ifa$="j"then4370
  426. 4260 ifa$="n"then4140
  427. 4270 goto4240
  428. 4280 fori=0to17
  429. 4290 input#3,z(i,0):next
  430. 4300 fori=0to7
  431. 4310 input#3,k(i,0):next
  432. 4320 input#3,s:input#3,as
  433. 4330 fori=1to4
  434. 4340 input#3,s(i):next
  435. 4350 close3:close15
  436. 4360 gosub3370:gosub3450
  437. 4370 return
  438. 4380 rem************************
  439. 4390 rem* name aus directory ***
  440. 4400 rem************************
  441. 4410 open1,8,0,"$"
  442. 4420 get#1,a$,a$
  443. 4430 get#1,a$,a$,l$,h$
  444. 4440 ifa$=""thenclose1:goto4410
  445. 4450 a0$=""
  446. 4460 get#1,a$:ifa$=""then4480
  447. 4470 a0$=a0$+a$:goto4460
  448. 4480 fori=1to16:a$=a$+chr$(32):next
  449. 4490 sp=16:ze=22:gosub670
  450. 4500 printa$
  451. 4510 sp=16:ze=22:gosub670
  452. 4520 a=asc(a0$):ifa=18then4430
  453. 4530 a0$=right$(a0$,len(a0$)-1)
  454. 4540 ifa=32then4520
  455. 4550 ifa<>34thenclose1:goto4410
  456. 4560 a=asc(right$(a0$,1))
  457. 4570 a0$=left$(a0$,len(a0$)-1)
  458. 4580 ifa<>34then4560
  459. 4590 printa0$
  460. 4600 print"ok?[160](j/n)"
  461. 4610 poke198,0
  462. 4620 geta$:ifa$="n"then4430
  463. 4630 ifa$<>"j"then4620
  464. 4640 close1:return
  465.